package com.marvels.financial.loan.service;
import com.marvels.financial.loan.dto.PaymentResponse;

import java.math.BigDecimal;

import com.marvels.common.exception.MarvelsBusinessException;
import com.marvels.financial.loan.dto.HandleWithholePaymentDTO;
import com.marvels.financial.loan.dto.McfeCustomerLoanContractDTO;
import com.marvels.financial.loan.dto.McfePaymentWithholdDTO;
import com.marvels.financial.loan.dto.McfePaymentWithholdDetailDTO;
import com.marvels.financial.loan.dto.WithholeQueryConditionDTO;

/**
 * 代扣支付
 * @author tangpw
 *
 */
public interface WithholdPaymentApi {
	
	
	/**
	 * 代扣支付
	 * @param conditionDTO
	 * @return
	 */
	public PaymentResponse withholdPayment(HandleWithholePaymentDTO conditionDTO) ;
	
	
	
	/**
	 * 代扣支付查询
	 * @param reqNo 请求编号
	 * @return
	 */
	public PaymentResponse withholdPaymentQuery(WithholeQueryConditionDTO dto);
	
	
	
	
	/**
	 * 代扣公共方法
	 * @param dto
	 */
	public PaymentResponse withholdCommonDeal(McfePaymentWithholdDTO dto) throws MarvelsBusinessException;
	 
	
	/**
	 * 代扣成功处理
	 * @param contractDto
	 * @param paymentWithholdDTO
	 * @param detailDTO
	 * @throws MarvelsBusinessException
	 */
	public void withholdSuccess(McfeCustomerLoanContractDTO contractDto,McfePaymentWithholdDTO paymentWithholdDTO,McfePaymentWithholdDetailDTO detailDTO)  throws MarvelsBusinessException;
	

	/**
	 * 展期费冲账
	 * @param loanId
	 * @param amount
	 * @param extensionDay
	 * @throws MarvelsBusinessException
	 */
	public void extensionwithholdeSuccess(String loanId, BigDecimal amount,int extensionDay) throws MarvelsBusinessException;	
	
	/**提前结清
	 * @param dto
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public PaymentResponse withholdPreSettleDeal(McfePaymentWithholdDTO paymentWithholdDTO) throws MarvelsBusinessException;
	
	
	
	/**
	 * 还款时 同步新绑定的卡到合同  还款计划表
	 * @param contractDto
	 * @return
	 */
	public McfeCustomerLoanContractDTO synchronizedBankCard(McfeCustomerLoanContractDTO contractDto,String channel) ;
	
}
